﻿#include "SnapImgItemDelegate.h"
#include "SnapImgDef.h"
#include "SnapImgItem.h"
#include <QDateTime>

namespace OfUI {

	SnapImgItemDelegate::SnapImgItemDelegate(QObject *parent)
		: QStyledItemDelegate(parent)
	{
	}

	SnapImgItemDelegate::~SnapImgItemDelegate()
	{
	}

	SnapImgItem* SnapImgItemDelegate::createEditor()
	{
		SnapImgItem* pItem = new SnapImgItem;
		return pItem;
	}

	QString SnapImgItemDelegate::getItemGroupTitle(const SnapDataGroup& group, const GroupType& eType)
	{
		QString strDateTime = QDateTime::fromSecsSinceEpoch(group.m_nGroupTime).toString(groupTypeFormat(eType));
		QString strTitle = QString("%1 %2Photos").arg(strDateTime).arg(group.m_nDataCount);
		return strTitle;
	}

}
